package com.mvc.Service.ImPI;

import com.mvc.Dao.UserDao;
import com.mvc.Pojo.Mvcdemo;
import com.mvc.Service.UserService;
import com.mvc.UtilS.SessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @auther linke
 * @create 2021-10-21 17:57
 */
public class UserServiceImpI implements UserService {


    @Override
    public List<Mvcdemo> findByAll() {
        try{
            SqlSession sqlSession = SessionUtil.getSqlSession();
            UserDao userDao = sqlSession.getMapper(UserDao.class);

            return userDao.findByAll();
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }

    }
}
